Skip to content

Conversation

@oakbani
Copy link
Contributor

@oakbani oakbani commented Dec 19, 2018

Summary

This updates project config and the audience evaluator to finish the implementation of typed audience evaluation:

  • In validator:isUserInExperiment, allow evaluation to continue when no user attributes are passed (previously we were immediately returning false when no attributes were passed)
  • Updated project_config to update audienceIdMap with typedAudiences
  • Added unit tests checking that all top-level methods that accept user attributes can bucket users into experiments or rollouts that use typed audiences.

Test Plan

  • New & existing unit tests
  • Ran compatibility suite tests for typed audiences

@oakbani
Copy link
Contributor Author

oakbani commented Dec 19, 2018

The project config decodes whole datafile in a way that converts json objects to associative arrays in PHP. This creates a difference in the way we handle normal audience conditions and typedAudience conditions as in other SDKs. The leaf condition inside typedAudiences auto convert into an associative array. Hence, I have changed the normal audience conditions decoding to sync it with typedAudience. And modified conditionTree/CustomAttr evaluators a bit to handle leaf nodes as arrays instead of objects.

Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I would like to understand why stringified number as a key is returning false for doesArrayContainOnlyStringKeys

@aliabbasrizvi aliabbasrizvi merged commit d617d18 into oakbani/audience-match-condition-evaluator-2 Dec 21, 2018
aliabbasrizvi added a commit that referenced this pull request Dec 21, 2018
…oject config for new audience match types (#145)"

This reverts commit d617d18.
oakbani added a commit that referenced this pull request Dec 24, 2018
…ce match types (#143)

* feat(audience match types): Update condition evaluator for new audience match types

* feat (audience match types): Update audience evaluator and project config for new audience match types (#145)
@oakbani oakbani deleted the oakbani/audience-match-project-config-2 branch December 31, 2018 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants